  
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="layout" content="main" />
    <title>Person List</title>
  </head>
  <body>
    <div class="nav">
      <span class="menuButton"><a href="${createLinkTo(dir:'')}">Home</a></span>
      <span class="menuButton"><g:link action="create">New Person</g:link></span>
    </div>
    <div class="body">
      <h1>Person List</h1>
      <g:if test="${flash.message}">
        <div class="message">
          ${flash.message}
        </div>
      </g:if>
      <table>
        <thead>
          <tr>
            <g:sortableColumn property="username" title="Login Name" />
            <g:sortableColumn property="userRealName" title="Full Name" />
            <g:sortableColumn property="description" title="Description" />
            <g:sortableColumn property="expertise" title="Expert in" />
            <g:sortableColumn property="category" title="Work in" />

            <th></th>
          </tr>
        </thead>
        <tbody>
          <g:each in="${personList}" var="person">
            <tr>
              <td><g:link action="show" id="${person.id}">${person?.username}</g:link></td>
              <td>${person.userRealName?.encodeAsHTML()}</td>
              <td>${person.description?.encodeAsHTML()}</td>
              <td>
                  <ul>
                  <g:each var="e" in="${person?.profile?.expertise}">
                      <li><g:link controller="user" action="listByExpertise" id="${e.id}">${e?.title}</g:link></li>
                  </g:each>
                  </ul>
              </td>
              <td>
                  <ul>
                  <g:each var="c" in="${person?.profile?.categories}">
                      <li><g:link controller="category" action="show" id="${c.id}">${c.title}</g:link></li>
                  </g:each>
                  </ul>
              </td>
            </tr>
          </g:each>
        </tbody>
      </table>
    
      <%--div class="paginateButtons">
        <g:paginate total="${Person.count()}" />
      </div--%>
      
    </div>
  </body>
</html>
